package com.example.emptytest;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.LinearInterpolator;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

// 插值器
public class Interpolator extends LinearInterpolator {
    private float factor;

    public Interpolator() {
        this.factor = 0.15f;
    }

    @Override
    public float getInterpolation(float input) {
        return (float) (Math.pow(2, -10 * input)
                * Math.sin((input - factor / 4) * (2 * Math.PI) / factor) + 1);
    }

    public static class TabFragment1_0 extends Fragment {
        private String mTitle;

        //这个构造方法是便于各导航同时调用一个fragment
        public TabFragment1_0(String title){
            mTitle=title;
        }

        @Override
        public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState){
            View view;
            if(mTitle.compareTo("社团信息修改") == 0)
                view=inflater.inflate(R.layout.fragment_tab1_0_1,container,false); //这里筛选 切换界面
            else if(mTitle.compareTo("成员操作") == 0)
                view=inflater.inflate(R.layout.fragment_tab1_0_2,container,false); //这里筛选 切换界面
            else if(mTitle.compareTo("发布活动") == 0)
                view=inflater.inflate(R.layout.fragment_tab1_0_3,container,false); //这里筛选 切换界面
            else if(mTitle.compareTo("活动审核") == 0)
                view=inflater.inflate(R.layout.fragment_tab1_0_4,container,false); //这里筛选 切换界面
            else
                view=inflater.inflate(R.layout.fragment_tab1_0_5,container,false); //这里筛选 切换界面
            System.out.println("初始化页面");
            return view;
        }
    }
}

